#coding:utf-8
"""
*   Coder    : Dzlua
*   Email    : 505544956@qq.com
*   Time     : 2017/09/29
"""
#--------------------#
from flask import Flask
from flask_script import Manager

#--------------------#
class Mgr:
    app = Flask(__name__)
    manager = Manager(app)
    #
    def config_from_file(self, pyfile):
        self.app.config.from_pyfile(pyfile)
    def config_from_object(self, object_name):
        self.app.config.from_object(object_name)
    def start(self):
        from app.cmds import Cmds
        from app.models import Models
        from app.views import Views
        from app.apis import Apis
        #----------#
        self.cmds = Cmds(self)
        self.models = Models(self)
        self.views = Views(self)
        self.apis = Apis(self)
    def run(self):
        self.manager.run()
#--------------------#
